package it.mauriziulu.android.ehttpexecutors.handler;

import it.mauriziulu.android.ehttpexecutors.ContentParser;
import it.mauriziulu.android.ehttpexecutors.cache.CacheManager;
import android.content.Context;

public abstract class CacheAwareResponseHandler extends DefaultResponseHandler {

	public CacheAwareResponseHandler(ContentParser parser) {
		super(parser);
	}

	private CacheManager mCacheManager;

	public void setCacheManager(CacheManager cacheManager) {
		mCacheManager = cacheManager;
	}

	public CacheManager getCacheManager() {
		return mCacheManager;
	}

	// @Override
	// public void handle(String content, Header[] header, int status) {
	// if (status == HttpStatus.SC_OK) {
	// CacheMetaEntry cMetaEntry = new CacheMetaEntry(header);
	// Serializable parsed = parse(content);
	// if (cMetaEntry.canCache()) {
	// mCacheManager.putMeta(mUrl, cMetaEntry);
	// mCacheManager.putContent(mUrl, new CacheEntry(content, parsed));
	// }
	// gotObject(parsed);
	// } else if (status == HttpStatus.SC_NOT_MODIFIED) {
	// gotObject(mCacheManager.getContent(mUrl).getStrucuredContent());
	// }
	//
	// }
}
